package cn.njxzc.book.masterexamples.ch14;

import java.util.*;
public class SetDemo3 {
      public static void main(String args[]) {
          boolean b;
          Set s = new HashSet();
          b = s.add("string1");
          System.out.println("string1 add returns " + b);
          b = s.add("string2");
          System.out.println("string2 add returns " + b);
          b = s.add("string3");
          System.out.println("string3 add returns " + b);
          b = s.add("string1");
          System.out.println("string1 add returns " + b);
          b = s.add("string2");
          System.out.println("string2 add returns " + b);
          Iterator i = s.iterator();
          while (i.hasNext()) 
               System.out.println(i.next());
      }
}
